package com.googlecode.everyidea.core.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class BaseSqlmapDao extends SqlMapClientDaoSupport {
	protected final int BATCH_BASE = 50;

	protected Object executeQueryForObject(String statementName) {
		return getSqlMapClientTemplate().queryForObject(statementName);
	}

	protected Object executeQueryForObject(String statementName,
			Object parameterObject) {
		return getSqlMapClientTemplate().queryForObject(statementName,
				parameterObject);
	}

	protected List executeQueryForList(String statementName) {
		return getSqlMapClientTemplate().queryForList(statementName);
	}

	protected List executeQueryForList(String statementName,
			Object parameterObject) {
		return getSqlMapClientTemplate().queryForList(statementName,
				parameterObject);
	}

	protected List executeQueryForList(String statementName, int skipResults,
			int maxResults) {
		return getSqlMapClientTemplate().queryForList(statementName,
				skipResults, maxResults);
	}

	protected List executeQueryForList(String statementName,
			Object parameterObject, int skipResults, int maxResults) {
		return getSqlMapClientTemplate().queryForList(statementName,
				parameterObject, skipResults, maxResults);
	}

	protected int executeUpdate(String statementName, Object parameterObject) {
		return getSqlMapClientTemplate().update(statementName, parameterObject);
	}

	protected Object executeInsert(String statementName, Object parameterObject) {
		return getSqlMapClientTemplate().insert(statementName, parameterObject);
	}

	protected Object executeDelete(String statementName, Object parameterObject) {
		return getSqlMapClientTemplate().delete(statementName, parameterObject);
	}

}
